"""
设备管理路由，主要涉及串口管理等
"""
from typing import List
from flask import Blueprint, request
import json

from ..services import list_serial_ports
blueprint_program_management = Blueprint("program_management", __name__, url_prefix="/api/program_management")


@blueprint_program_management.route("/serials", methods=["GET"])
def all_serials():
    return (
        json.dumps(list_serial_ports()),
        200,
    )